<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title><c:if test="${cust!=null}">
    <c:out value="${cust.custName}" />-</c:if>用户详情</title>
<c:import url="/ctrl/header"></c:import>
</head>
<body>
  <c:import url="/ctrl/top"></c:import>
  <div class="container">
    <div class="row-fluid">
      <!--/span-->
      <div class="span12">
        <h3 class="greybg">用户详情</h3>
        <c:choose>
          <c:when test="${cust!=null}">
            <form>
              <table
                class="table table-bcusted table-striped responsive-utilities">
                <thead>
                  <tr>
                    <th colspan="4">基本信息</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>用户名</td>
                    <td>${cust.custName}</td>
                    <td>注册日期</td>
                    <td><fmt:formatDate var="custCreatedOn"
                        pattern="yyyy-MM-dd HH:mm"
                        value="${cust.custCreatedOn}" /> <c:out
                        value="${custCreatedOn}" /></td>
                  </tr>
                  <tr>
                    <td>密码</td>
                    <td><input type="password" id="pwd" />注：留空则不修改密码</td>
                    <td>email</td>
                    <td><input type="text" id="email"
                      value="<c:out value="${cust.custEmail}"/>" /></td>
                  </tr>
                  <tr>
                    <td>用户等级</td>
                    <td><select name="level" id="level">
                        <option value=""></option>
                        <c:forEach var="level" items="${levelList}">
                          <option
                            value="<c:out value="${level.levelId}" />"
                            <c:if test="${cust.custLevelFid==level.levelId}">selected="selected"</c:if>><c:out
                              value="${level.levelName}" /></option>
                        </c:forEach>
                    </select></td>
                    <td>可用余额</td>
                    <td><input type="text" name="usefulFee"
                      id="usefulFee"
                      value="<c:out value="${cust.custUsefulFee}"/>" /></td>
                  </tr>
                  <tr>
                    <td>状态</td>
                    <td><select name="status" id="status">
                        <c:forEach var="status" items="${statusList}">
                          <option
                            value="<c:out value="${status.index}" />"
                            <c:if test="${cust.custStatus==status.index}">selected="selected"</c:if>><c:out
                              value="${status.name}" /></option>
                        </c:forEach>
                    </select></td>
                    <td>是否内部用户</td>
                    <td><input type="checkbox" id="userFlg"
                      name="userFlg"
                      <c:if test="${cust.custUserFlg=='1'}">checked="checked"</c:if> />
                    </td>
                  </tr>
                  <tr>
                    <td>联系人姓名</td>
                    <td><input type="text" name="contactName"
                      id="contactName"
                      value="<c:out value="${custExt.extContactName}"/>" /></td>
                    <td>联系人电话</td>
                    <td><input type="text" name="contactTel"
                      id="contactTel"
                      value="<c:out value="${custExt.extContactTel}"/>" /></td>
                  </tr>
                  <tr>
                    <th colspan="4">其他信息</th>
                  </tr>
                  <tr>
                    <td>其他联系方式</td>
                    <td><input type="text" name="contactOthers"
                      id="contactOthers"
                      value="<c:out value="${custExt.extContactOthers}"/>" /></td>
                    <td>公司名称</td>
                    <td><input type="text" name="companyName"
                      id="companyName"
                      value="<c:out value="${custExt.extCompanyName}"/>" /></td>
                  </tr>
                  <tr>
                    <td>公司邮编</td>
                    <td><input type="text" name="companyZip"
                      id="companyZip"
                      value="<c:out value="${custExt.extCompanyZip}"/>" /></td>
                    <td>公司地址</td>
                    <td><input type="text" name="companyAddress"
                      id="companyAddress"
                      value="<c:out value="${custExt.extCompanyAddress}"/>" /></td>
                  </tr>
                  <tr>
                    <td>公司电话</td>
                    <td><input type="text" name="companyTel"
                      id="companyTel"
                      value="<c:out value="${custExt.extCompanyTel}"/>" /></td>
                    <td>公司传真</td>
                    <td><input type="text" name="companyFax"
                      id="companyFax"
                      value="<c:out value="${custExt.extCompanyFax}"/>" /></td>
                  </tr>
                  <tr>
                    <td>公司邮箱</td>
                    <td><input type="text" name="companyEmail"
                      id="companyEmail"
                      value="<c:out value="${custExt.extCompanyEmail}"/>" /></td>
                    <td>公司网站</td>
                    <td><input type="text" name="companyWebsite"
                      id="companyWebsite"
                      value="<c:out value="${custExt.extCompanyWebsite}"/>" /></td>
                  </tr>
                  <tr>
                    <td>公司注册号</td>
                    <td><input type="text" name="companyReg"
                      id="companyReg"
                      value="<c:out value="${custExt.extCompanyReg}"/>" /></td>
                    <td>负责人姓名</td>
                    <td><input type="text" name="chargeName"
                      id="chargeName"
                      value="<c:out value="${custExt.extChargeName}"/>" /></td>
                  </tr>
                  <tr>
                    <td>了解途径</td>
                    <td colspan="3"><c:forEach var="from"
                        items="${fromList}">
                        <input type="radio" name="from"
                          value="<c:out value="${from.name}" />"
                          <c:if test="${custExt.extFrom==from.name}">checked="checked"</c:if> />
                        <c:out value="${from.name}" />
                      </c:forEach></td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align: center"><input
                      type="button" value="修改"
                      class="button btn-big btn-orange"
                      onclick="submitCustModify('<c:out value="${cust.custId}" />');" /></td>
                  </tr>
                </tbody>
              </table>
            </form>
          </c:when>
          <c:otherwise>
            <h5>没有相关信息</h5>
          </c:otherwise>
        </c:choose>
      </div>
    </div>
    <hr />
    <c:import url="/ctrl/bottom"></c:import>
  </div>
  <c:import url="/ctrl/footer"></c:import>
</body>
</html>